﻿Imports System.Data.OleDb
Public Class InsteadLocalidades

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If txt_INSTEAD_LOCALIDAD_NW.Text <> "" Then
            Main.btn_NW.BackColor = Color.Yellow
        Else
            Main.btn_NW.BackColor = System.Drawing.SystemColors.ButtonFace
        End If
        If txt_INSTEAD_LOCALIDAD_N.Text <> "" Then
            Main.btn_N.BackColor = Color.Yellow
        Else
            Main.btn_N.BackColor = System.Drawing.SystemColors.ButtonFace
        End If
        If txt_INSTEAD_LOCALIDAD_NE.Text <> "" Then
            Main.btn_NE.BackColor = Color.Yellow
        Else
            Main.btn_NE.BackColor = System.Drawing.SystemColors.ButtonFace
        End If


        If txt_INSTEAD_LOCALIDAD_W.Text <> "" Then
            Main.btn_W.BackColor = Color.Yellow
        Else
            Main.btn_W.BackColor = System.Drawing.SystemColors.ButtonFace
        End If
        If txt_INSTEAD_LOCALIDAD_E.Text <> "" Then
            Main.btn_E.BackColor = Color.Yellow
        Else
            Main.btn_E.BackColor = System.Drawing.SystemColors.ButtonFace
        End If



        If txt_INSTEAD_LOCALIDAD_SW.Text <> "" Then
            Main.btn_SW.BackColor = Color.Yellow
        Else
            Main.btn_SW.BackColor = System.Drawing.SystemColors.ButtonFace
        End If
        If txt_INSTEAD_LOCALIDAD_S.Text <> "" Then
            Main.btn_S.BackColor = Color.Yellow
        Else
            Main.btn_S.BackColor = System.Drawing.SystemColors.ButtonFace
        End If
        If txt_INSTEAD_LOCALIDAD_SE.Text <> "" Then
            Main.btn_SE.BackColor = Color.Yellow
        Else
            Main.btn_SE.BackColor = System.Drawing.SystemColors.ButtonFace
        End If


        If txt_INSTEAD_LOCALIDAD_ENTRAR.Text <> "" Then
            Main.btn_EN.BackColor = Color.Yellow
        Else
            Main.btn_EN.BackColor = System.Drawing.SystemColors.ButtonFace
        End If
        If txt_INSTEAD_LOCALIDAD_SALIR.Text <> "" Then
            Main.btn_SA.BackColor = Color.Yellow
        Else
            Main.btn_SA.BackColor = System.Drawing.SystemColors.ButtonFace
        End If

        If txt_INSTEAD_LOCALIDAD_SUBIR.Text <> "" Then
            Main.btn_SU.BackColor = Color.Yellow
        Else
            Main.btn_SU.BackColor = System.Drawing.SystemColors.ButtonFace
        End If
        If txt_INSTEAD_LOCALIDAD_BAJAR.Text <> "" Then
            Main.btn_BA.BackColor = Color.Yellow
        Else
            Main.btn_BA.BackColor = System.Drawing.SystemColors.ButtonFace
        End If



        Me.Close()

    End Sub

    Private Sub Label8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label8.Click

    End Sub

    Private Sub txt_INSTEAD_LOCALIDAD_NW_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txt_INSTEAD_LOCALIDAD_NW.LostFocus

        txt_INSTEAD_LOCALIDAD_NW.Text = Replace(txt_INSTEAD_LOCALIDAD_NW.Text, """", "")
        txt_INSTEAD_LOCALIDAD_NW.Text = Replace(txt_INSTEAD_LOCALIDAD_NW.Text, "'", "")

        txt_INSTEAD_LOCALIDAD_NW.Text = CombrobarPuntoFinal(txt_INSTEAD_LOCALIDAD_NW.Text)
        '==============================================================================================
        'COMENTARIOS. Procedimiento encargado de grabar EL INSTEAD NW DE LA LOCALIDAD EN LA B.D.
        '==============================================================================================

        'Se establece la conexión con la base de datos.
        Dim sCnn As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & txtBase
        Dim ODbConn As New OleDb.OleDbConnection(sCnn)
        ODbConn.Open()

        'Se crea un objeto Command 
        Dim Command As New OleDb.OleDbCommand("UPDATE LOCALIDADES SET LOCALIDADES.InsteadNW = " & "'" & txt_INSTEAD_LOCALIDAD_NW.Text & "'" & "WHERE LOCALIDADES.NombreLocalidad=" & "'" & Main.txt_LOCALIDAD_NOMBRE.Text & "'", ODbConn)
        Dim DataReader As OleDbDataReader = Command.ExecuteReader(CommandBehavior.CloseConnection)

        'Libera memoria
        Command.Dispose()
        ODbConn.Close()
    End Sub

    Private Sub txt_INSTEAD_LOCALIDAD_NW_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txt_INSTEAD_LOCALIDAD_NW.TextChanged
        If txt_INSTEAD_LOCALIDAD_NW.Text <> "" Then
            Main.btn_NW.BackColor = Color.Yellow
        Else
            Main.btn_NW.BackColor = System.Drawing.SystemColors.ButtonFace
        End If
    End Sub

    Private Sub InsteadLocalidades_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
        Select Case Main.Boton_Picado
            Case "NW"
                txt_INSTEAD_LOCALIDAD_NW.Focus()
            Case "N"
                txt_INSTEAD_LOCALIDAD_N.Focus()
            Case "NE"
                txt_INSTEAD_LOCALIDAD_NE.Focus()
            Case "W"
                txt_INSTEAD_LOCALIDAD_W.Focus()
            Case "E"
                txt_INSTEAD_LOCALIDAD_E.Focus()
            Case "SW"
                txt_INSTEAD_LOCALIDAD_SW.Focus()
            Case "S"
                txt_INSTEAD_LOCALIDAD_S.Focus()
            Case "SE"
                txt_INSTEAD_LOCALIDAD_SE.Focus()
            Case "EN"
                txt_INSTEAD_LOCALIDAD_ENTRAR.Focus()
            Case "SA"
                txt_INSTEAD_LOCALIDAD_SALIR.Focus()
            Case "SU"
                txt_INSTEAD_LOCALIDAD_SUBIR.Focus()
            Case "BA"
                txt_INSTEAD_LOCALIDAD_BAJAR.Focus()
        End Select
    End Sub

    Private Sub txt_INSTEAD_LOCALIDAD_N_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txt_INSTEAD_LOCALIDAD_N.LostFocus


        txt_INSTEAD_LOCALIDAD_N.Text = Replace(txt_INSTEAD_LOCALIDAD_N.Text, """", "")
        txt_INSTEAD_LOCALIDAD_N.Text = Replace(txt_INSTEAD_LOCALIDAD_N.Text, "'", "")
        txt_INSTEAD_LOCALIDAD_N.Text = CombrobarPuntoFinal(txt_INSTEAD_LOCALIDAD_N.Text)
        '==============================================================================================
        'COMENTARIOS. Procedimiento encargado de grabar EL INSTEAD N DE LA LOCALIDAD EN LA B.D.
        '==============================================================================================

        'Se establece la conexión con la base de datos.
        Dim sCnn As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & txtBase
        Dim ODbConn As New OleDb.OleDbConnection(sCnn)
        ODbConn.Open()

        'Se crea un objeto Command 
        Dim Command As New OleDb.OleDbCommand("UPDATE LOCALIDADES SET LOCALIDADES.InsteadN = " & "'" & txt_INSTEAD_LOCALIDAD_N.Text & "'" & "WHERE LOCALIDADES.NombreLocalidad=" & "'" & Main.txt_LOCALIDAD_NOMBRE.Text & "'", ODbConn)
        Dim DataReader As OleDbDataReader = Command.ExecuteReader(CommandBehavior.CloseConnection)

        'Libera memoria
        Command.Dispose()
        ODbConn.Close()
    End Sub

    Private Sub txt_INSTEAD_LOCALIDAD_N_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txt_INSTEAD_LOCALIDAD_N.TextChanged
        If txt_INSTEAD_LOCALIDAD_N.Text <> "" Then
            Main.btn_N.BackColor = Color.Yellow
        Else
            Main.btn_N.BackColor = System.Drawing.SystemColors.ButtonFace
        End If
    End Sub

    Private Sub txt_INSTEAD_LOCALIDAD_NE_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txt_INSTEAD_LOCALIDAD_NE.LostFocus


        txt_INSTEAD_LOCALIDAD_NE.Text = Replace(txt_INSTEAD_LOCALIDAD_NE.Text, """", "")
        txt_INSTEAD_LOCALIDAD_NE.Text = Replace(txt_INSTEAD_LOCALIDAD_NE.Text, "'", "")
        txt_INSTEAD_LOCALIDAD_NE.Text = CombrobarPuntoFinal(txt_INSTEAD_LOCALIDAD_NE.Text)
        '==============================================================================================
        'COMENTARIOS. Procedimiento encargado de grabar EL INSTEAD NE DE LA LOCALIDAD EN LA B.D.
        '==============================================================================================

        'Se establece la conexión con la base de datos.
        Dim sCnn As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & txtBase
        Dim ODbConn As New OleDb.OleDbConnection(sCnn)
        ODbConn.Open()

        'Se crea un objeto Command 
        Dim Command As New OleDb.OleDbCommand("UPDATE LOCALIDADES SET LOCALIDADES.InsteadNE = " & "'" & txt_INSTEAD_LOCALIDAD_NE.Text & "'" & "WHERE LOCALIDADES.NombreLocalidad=" & "'" & Main.txt_LOCALIDAD_NOMBRE.Text & "'", ODbConn)
        Dim DataReader As OleDbDataReader = Command.ExecuteReader(CommandBehavior.CloseConnection)

        'Libera memoria
        Command.Dispose()
        ODbConn.Close()
    End Sub

    Private Sub txt_INSTEAD_LOCALIDAD_NE_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txt_INSTEAD_LOCALIDAD_NE.TextChanged
        If txt_INSTEAD_LOCALIDAD_NE.Text <> "" Then
            Main.btn_NE.BackColor = Color.Yellow
        Else
            Main.btn_NE.BackColor = System.Drawing.SystemColors.ButtonFace
        End If
    End Sub

    Private Sub txt_INSTEAD_LOCALIDAD_W_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txt_INSTEAD_LOCALIDAD_W.LostFocus

        txt_INSTEAD_LOCALIDAD_W.Text = Replace(txt_INSTEAD_LOCALIDAD_W.Text, """", "")
        txt_INSTEAD_LOCALIDAD_W.Text = Replace(txt_INSTEAD_LOCALIDAD_W.Text, "'", "")
        txt_INSTEAD_LOCALIDAD_W.Text = CombrobarPuntoFinal(txt_INSTEAD_LOCALIDAD_W.Text)
        '==============================================================================================
        'COMENTARIOS. Procedimiento encargado de grabar EL INSTEAD W DE LA LOCALIDAD EN LA B.D.
        '==============================================================================================

        'Se establece la conexión con la base de datos.
        Dim sCnn As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & txtBase
        Dim ODbConn As New OleDb.OleDbConnection(sCnn)
        ODbConn.Open()

        'Se crea un objeto Command 
        Dim Command As New OleDb.OleDbCommand("UPDATE LOCALIDADES SET LOCALIDADES.InsteadW = " & "'" & txt_INSTEAD_LOCALIDAD_W.Text & "'" & "WHERE LOCALIDADES.NombreLocalidad=" & "'" & Main.txt_LOCALIDAD_NOMBRE.Text & "'", ODbConn)
        Dim DataReader As OleDbDataReader = Command.ExecuteReader(CommandBehavior.CloseConnection)

        'Libera memoria
        Command.Dispose()
        ODbConn.Close()
    End Sub

    Private Sub txt_INSTEAD_LOCALIDAD_W_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txt_INSTEAD_LOCALIDAD_W.TextChanged
        If txt_INSTEAD_LOCALIDAD_W.Text <> "" Then
            Main.btn_W.BackColor = Color.Yellow
        Else
            Main.btn_W.BackColor = System.Drawing.SystemColors.ButtonFace
        End If
    End Sub

    Private Sub txt_INSTEAD_LOCALIDAD_E_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txt_INSTEAD_LOCALIDAD_E.LostFocus

        txt_INSTEAD_LOCALIDAD_E.Text = Replace(txt_INSTEAD_LOCALIDAD_E.Text, """", "")
        txt_INSTEAD_LOCALIDAD_E.Text = Replace(txt_INSTEAD_LOCALIDAD_E.Text, "'", "")
        txt_INSTEAD_LOCALIDAD_E.Text = CombrobarPuntoFinal(txt_INSTEAD_LOCALIDAD_E.Text)
        '==============================================================================================
        'COMENTARIOS. Procedimiento encargado de grabar EL INSTEAD E DE LA LOCALIDAD EN LA B.D.
        '==============================================================================================

        'Se establece la conexión con la base de datos.
        Dim sCnn As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & txtBase
        Dim ODbConn As New OleDb.OleDbConnection(sCnn)
        ODbConn.Open()

        'Se crea un objeto Command 
        Dim Command As New OleDb.OleDbCommand("UPDATE LOCALIDADES SET LOCALIDADES.InsteadE = " & "'" & txt_INSTEAD_LOCALIDAD_E.Text & "'" & "WHERE LOCALIDADES.NombreLocalidad=" & "'" & Main.txt_LOCALIDAD_NOMBRE.Text & "'", ODbConn)
        Dim DataReader As OleDbDataReader = Command.ExecuteReader(CommandBehavior.CloseConnection)

        'Libera memoria
        Command.Dispose()
        ODbConn.Close()
    End Sub

    Private Sub txt_INSTEAD_LOCALIDAD_E_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txt_INSTEAD_LOCALIDAD_E.TextChanged
        If txt_INSTEAD_LOCALIDAD_E.Text <> "" Then
            Main.btn_E.BackColor = Color.Yellow
        Else
            Main.btn_E.BackColor = System.Drawing.SystemColors.ButtonFace
        End If
    End Sub

    Private Sub txt_INSTEAD_LOCALIDAD_SW_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txt_INSTEAD_LOCALIDAD_SW.LostFocus

        txt_INSTEAD_LOCALIDAD_SW.Text = Replace(txt_INSTEAD_LOCALIDAD_SW.Text, """", "")
        txt_INSTEAD_LOCALIDAD_SW.Text = Replace(txt_INSTEAD_LOCALIDAD_SW.Text, "'", "")
        txt_INSTEAD_LOCALIDAD_SW.Text = CombrobarPuntoFinal(txt_INSTEAD_LOCALIDAD_SW.Text)
        '==============================================================================================
        'COMENTARIOS. Procedimiento encargado de grabar EL INSTEAD SW DE LA LOCALIDAD EN LA B.D.
        '==============================================================================================

        'Se establece la conexión con la base de datos.
        Dim sCnn As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & txtBase
        Dim ODbConn As New OleDb.OleDbConnection(sCnn)
        ODbConn.Open()

        'Se crea un objeto Command 
        Dim Command As New OleDb.OleDbCommand("UPDATE LOCALIDADES SET LOCALIDADES.InsteadSW = " & "'" & txt_INSTEAD_LOCALIDAD_SW.Text & "'" & "WHERE LOCALIDADES.NombreLocalidad=" & "'" & Main.txt_LOCALIDAD_NOMBRE.Text & "'", ODbConn)
        Dim DataReader As OleDbDataReader = Command.ExecuteReader(CommandBehavior.CloseConnection)

        'Libera memoria
        Command.Dispose()
        ODbConn.Close()
    End Sub

    Private Sub txt_INSTEAD_LOCALIDAD_SW_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txt_INSTEAD_LOCALIDAD_SW.TextChanged
        If txt_INSTEAD_LOCALIDAD_SW.Text <> "" Then
            Main.btn_SW.BackColor = Color.Yellow
        Else
            Main.btn_SW.BackColor = System.Drawing.SystemColors.ButtonFace
        End If
    End Sub

    Private Sub txt_INSTEAD_LOCALIDAD_S_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txt_INSTEAD_LOCALIDAD_S.LostFocus

        txt_INSTEAD_LOCALIDAD_S.Text = Replace(txt_INSTEAD_LOCALIDAD_S.Text, """", "")
        txt_INSTEAD_LOCALIDAD_S.Text = Replace(txt_INSTEAD_LOCALIDAD_S.Text, "'", "")
        txt_INSTEAD_LOCALIDAD_S.Text = CombrobarPuntoFinal(txt_INSTEAD_LOCALIDAD_S.Text)
        '==============================================================================================
        'COMENTARIOS. Procedimiento encargado de grabar EL INSTEAD S DE LA LOCALIDAD EN LA B.D.
        '==============================================================================================

        'Se establece la conexión con la base de datos.
        Dim sCnn As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & txtBase
        Dim ODbConn As New OleDb.OleDbConnection(sCnn)
        ODbConn.Open()

        'Se crea un objeto Command 
        Dim Command As New OleDb.OleDbCommand("UPDATE LOCALIDADES SET LOCALIDADES.InsteadS = " & "'" & txt_INSTEAD_LOCALIDAD_S.Text & "'" & "WHERE LOCALIDADES.NombreLocalidad=" & "'" & Main.txt_LOCALIDAD_NOMBRE.Text & "'", ODbConn)
        Dim DataReader As OleDbDataReader = Command.ExecuteReader(CommandBehavior.CloseConnection)

        'Libera memoria
        Command.Dispose()
        ODbConn.Close()
    End Sub

    Private Sub txt_INSTEAD_LOCALIDAD_SE_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txt_INSTEAD_LOCALIDAD_SE.LostFocus

        txt_INSTEAD_LOCALIDAD_SE.Text = Replace(txt_INSTEAD_LOCALIDAD_SE.Text, """", "")
        txt_INSTEAD_LOCALIDAD_SE.Text = Replace(txt_INSTEAD_LOCALIDAD_SE.Text, "'", "")
        txt_INSTEAD_LOCALIDAD_SE.Text = CombrobarPuntoFinal(txt_INSTEAD_LOCALIDAD_SE.Text)
        '==============================================================================================
        'COMENTARIOS. Procedimiento encargado de grabar EL INSTEAD SE DE LA LOCALIDAD EN LA B.D.
        '==============================================================================================

        'Se establece la conexión con la base de datos.
        Dim sCnn As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & txtBase
        Dim ODbConn As New OleDb.OleDbConnection(sCnn)
        ODbConn.Open()

        'Se crea un objeto Command 
        Dim Command As New OleDb.OleDbCommand("UPDATE LOCALIDADES SET LOCALIDADES.InsteadSE = " & "'" & txt_INSTEAD_LOCALIDAD_SE.Text & "'" & "WHERE LOCALIDADES.NombreLocalidad=" & "'" & Main.txt_LOCALIDAD_NOMBRE.Text & "'", ODbConn)
        Dim DataReader As OleDbDataReader = Command.ExecuteReader(CommandBehavior.CloseConnection)

        'Libera memoria
        Command.Dispose()
        ODbConn.Close()
    End Sub

    Private Sub txt_INSTEAD_LOCALIDAD_ENTRAR_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txt_INSTEAD_LOCALIDAD_ENTRAR.LostFocus

        txt_INSTEAD_LOCALIDAD_ENTRAR.Text = Replace(txt_INSTEAD_LOCALIDAD_ENTRAR.Text, """", "")
        txt_INSTEAD_LOCALIDAD_ENTRAR.Text = Replace(txt_INSTEAD_LOCALIDAD_ENTRAR.Text, "'", "")
        txt_INSTEAD_LOCALIDAD_ENTRAR.Text = CombrobarPuntoFinal(txt_INSTEAD_LOCALIDAD_ENTRAR.Text)
        '==============================================================================================
        'COMENTARIOS. Procedimiento encargado de grabar EL INSTEAD ENTRAR DE LA LOCALIDAD EN LA B.D.
        '==============================================================================================

        'Se establece la conexión con la base de datos.
        Dim sCnn As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & txtBase
        Dim ODbConn As New OleDb.OleDbConnection(sCnn)
        ODbConn.Open()

        'Se crea un objeto Command 
        Dim Command As New OleDb.OleDbCommand("UPDATE LOCALIDADES SET LOCALIDADES.InsteadEntrar = " & "'" & txt_INSTEAD_LOCALIDAD_ENTRAR.Text & "'" & "WHERE LOCALIDADES.NombreLocalidad=" & "'" & Main.txt_LOCALIDAD_NOMBRE.Text & "'", ODbConn)
        Dim DataReader As OleDbDataReader = Command.ExecuteReader(CommandBehavior.CloseConnection)

        'Libera memoria
        Command.Dispose()
        ODbConn.Close()
    End Sub

    Private Sub txt_INSTEAD_LOCALIDAD_SALIR_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txt_INSTEAD_LOCALIDAD_SALIR.LostFocus

        txt_INSTEAD_LOCALIDAD_SALIR.Text = Replace(txt_INSTEAD_LOCALIDAD_SALIR.Text, """", "")
        txt_INSTEAD_LOCALIDAD_SALIR.Text = Replace(txt_INSTEAD_LOCALIDAD_SALIR.Text, "'", "")
        txt_INSTEAD_LOCALIDAD_SALIR.Text = CombrobarPuntoFinal(txt_INSTEAD_LOCALIDAD_SALIR.Text)
        '==============================================================================================
        'COMENTARIOS. Procedimiento encargado de grabar EL INSTEAD SALIR DE LA LOCALIDAD EN LA B.D.
        '==============================================================================================

        'Se establece la conexión con la base de datos.
        Dim sCnn As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & txtBase
        Dim ODbConn As New OleDb.OleDbConnection(sCnn)
        ODbConn.Open()

        'Se crea un objeto Command 
        Dim Command As New OleDb.OleDbCommand("UPDATE LOCALIDADES SET LOCALIDADES.InsteadSalir = " & "'" & txt_INSTEAD_LOCALIDAD_SALIR.Text & "'" & "WHERE LOCALIDADES.NombreLocalidad=" & "'" & Main.txt_LOCALIDAD_NOMBRE.Text & "'", ODbConn)
        Dim DataReader As OleDbDataReader = Command.ExecuteReader(CommandBehavior.CloseConnection)

        'Libera memoria
        Command.Dispose()
        ODbConn.Close()
    End Sub

    Private Sub txt_INSTEAD_LOCALIDAD_SUBIR_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txt_INSTEAD_LOCALIDAD_SUBIR.LostFocus

        txt_INSTEAD_LOCALIDAD_SUBIR.Text = Replace(txt_INSTEAD_LOCALIDAD_SUBIR.Text, """", "")
        txt_INSTEAD_LOCALIDAD_SUBIR.Text = Replace(txt_INSTEAD_LOCALIDAD_SUBIR.Text, "'", "")
        txt_INSTEAD_LOCALIDAD_SUBIR.Text = CombrobarPuntoFinal(txt_INSTEAD_LOCALIDAD_SUBIR.Text)
        '==============================================================================================
        'COMENTARIOS. Procedimiento encargado de grabar EL INSTEAD SUBIR DE LA LOCALIDAD EN LA B.D.
        '==============================================================================================

        'Se establece la conexión con la base de datos.
        Dim sCnn As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & txtBase
        Dim ODbConn As New OleDb.OleDbConnection(sCnn)
        ODbConn.Open()

        'Se crea un objeto Command 
        Dim Command As New OleDb.OleDbCommand("UPDATE LOCALIDADES SET LOCALIDADES.InsteadSubir = " & "'" & txt_INSTEAD_LOCALIDAD_SUBIR.Text & "'" & "WHERE LOCALIDADES.NombreLocalidad=" & "'" & Main.txt_LOCALIDAD_NOMBRE.Text & "'", ODbConn)
        Dim DataReader As OleDbDataReader = Command.ExecuteReader(CommandBehavior.CloseConnection)

        'Libera memoria
        Command.Dispose()
        ODbConn.Close()
    End Sub

 
    Private Sub txt_INSTEAD_LOCALIDAD_BAJAR_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txt_INSTEAD_LOCALIDAD_BAJAR.LostFocus

        txt_INSTEAD_LOCALIDAD_BAJAR.Text = Replace(txt_INSTEAD_LOCALIDAD_BAJAR.Text, """", "")
        txt_INSTEAD_LOCALIDAD_BAJAR.Text = Replace(txt_INSTEAD_LOCALIDAD_BAJAR.Text, "'", "")
        txt_INSTEAD_LOCALIDAD_BAJAR.Text = CombrobarPuntoFinal(txt_INSTEAD_LOCALIDAD_BAJAR.Text)
        '==============================================================================================
        'COMENTARIOS. Procedimiento encargado de grabar EL INSTEAD BAJAR DE LA LOCALIDAD EN LA B.D.
        '==============================================================================================

        'Se establece la conexión con la base de datos.
        Dim sCnn As String = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & txtBase
        Dim ODbConn As New OleDb.OleDbConnection(sCnn)
        ODbConn.Open()

        'Se crea un objeto Command 
        Dim Command As New OleDb.OleDbCommand("UPDATE LOCALIDADES SET LOCALIDADES.InsteadBajar = " & "'" & txt_INSTEAD_LOCALIDAD_BAJAR.Text & "'" & "WHERE LOCALIDADES.NombreLocalidad=" & "'" & Main.txt_LOCALIDAD_NOMBRE.Text & "'", ODbConn)
        Dim DataReader As OleDbDataReader = Command.ExecuteReader(CommandBehavior.CloseConnection)

        'Libera memoria
        Command.Dispose()
        ODbConn.Close()
    End Sub

    Private Sub txt_INSTEAD_LOCALIDAD_S_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txt_INSTEAD_LOCALIDAD_S.TextChanged
        If txt_INSTEAD_LOCALIDAD_S.Text <> "" Then
            Main.btn_S.BackColor = Color.Yellow
        Else
            Main.btn_S.BackColor = System.Drawing.SystemColors.ButtonFace
        End If
    End Sub

    Private Sub txt_INSTEAD_LOCALIDAD_SE_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txt_INSTEAD_LOCALIDAD_SE.TextChanged
        If txt_INSTEAD_LOCALIDAD_SE.Text <> "" Then
            Main.btn_SE.BackColor = Color.Yellow
        Else
            Main.btn_SE.BackColor = System.Drawing.SystemColors.ButtonFace
        End If
    End Sub

    Private Sub txt_INSTEAD_LOCALIDAD_ENTRAR_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txt_INSTEAD_LOCALIDAD_ENTRAR.TextChanged
        If txt_INSTEAD_LOCALIDAD_ENTRAR.Text <> "" Then
            Main.btn_EN.BackColor = Color.Yellow
        Else
            Main.btn_EN.BackColor = System.Drawing.SystemColors.ButtonFace
        End If
    End Sub

    Private Sub txt_INSTEAD_LOCALIDAD_SALIR_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txt_INSTEAD_LOCALIDAD_SALIR.TextChanged
        If txt_INSTEAD_LOCALIDAD_SALIR.Text <> "" Then
            Main.btn_SA.BackColor = Color.Yellow
        Else
            Main.btn_SA.BackColor = System.Drawing.SystemColors.ButtonFace
        End If
    End Sub

    Private Sub txt_INSTEAD_LOCALIDAD_SUBIR_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txt_INSTEAD_LOCALIDAD_SUBIR.TextChanged
        If txt_INSTEAD_LOCALIDAD_SUBIR.Text <> "" Then
            Main.btn_SU.BackColor = Color.Yellow
        Else
            Main.btn_SU.BackColor = System.Drawing.SystemColors.ButtonFace
        End If
    End Sub

    Private Sub txt_INSTEAD_LOCALIDAD_BAJAR_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txt_INSTEAD_LOCALIDAD_BAJAR.TextChanged
        If txt_INSTEAD_LOCALIDAD_BAJAR.Text <> "" Then
            Main.btn_BA.BackColor = Color.Yellow
        Else
            Main.btn_BA.BackColor = System.Drawing.SystemColors.ButtonFace
        End If
    End Sub

    Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
        DarFormatoTexto()
    End Sub
End Class